﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Private_NoPromotion.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content2" ContentPlaceHolderID="TitleHolder" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadHolder" runat="server">
    <script type="text/javascript" src="/../Scripts/public.js"></script>
    <script type="text/javascript">
        jQuery(document).ready(function () {
            
            $("#Create-Album")
			.click(function () {
			    $("#dialog-form").dialog("open");
			});

            function updateTips(t) {
                tips
				.text(t)
				.addClass("ui-state-highlight");
                setTimeout(function () {
                    tips.removeClass("ui-state-highlight", 1500);
                }, 500);
            }

            $("#dialog-form").dialog({
                autoOpen: false,
                height: 230,
                width: 450,
                modal: true,
                buttons: {
                    "Thêm album": function () {
                        var bValid = true;
                        if ($("#AblumName").val() == "" || $("#AlbumThumbnail").val() == "") {
                            $("#errors").html("Vui lòng điền đầy đủ thông tin !.");
                            updateTips("Vui lòng điền đầy đủ thông tin !.");
                            bValid = false;
                        }
                        else {
                            bValid = true;
                            $("#errors").html("");
                        }
                        if (bValid) {
                            SubmitData_Ajax("frm_AddAlbum", "")
                            $(this).dialog("close");
                        }
                    },
                    "Hủy": function () {
                        $(this).dialog("close");
                    }
                },
                close: function () {
                    $("#errors").html("");
                }
            });

            $('#aAddPhoto').click(function () {
                for (var i = 1; i <= <%=WebHoiChoMuaBan.Controllers.Global.Config.MAX_FILE_UPLOAD %>; i++) {
                    if ($('#uploader' + i).is(':hidden')) {
                        $('#uploader' + i).show();
                        i = <%=WebHoiChoMuaBan.Controllers.Global.Config.MAX_FILE_UPLOAD %>;
                    }
                }
            });
        });
               
    </script>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentHolder" runat="server">
    <div id="dialog-form" title="Thêm Album mới">
	    <form action="<%=Url.Action("AddAlbum","Photo", new {uid=Session["MemId"]}) %>" id="frm_AddAlbum" method="post" enctype="multipart/form-data">
		    <table style="margin-top : 10px" cellspacing = "100px">
                <tr>
                    <td>
                        <div id="errors" style="color:red; font-weight:bold">&nbsp;</div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="AblumName">Tên ablum </label><br />
                        <input type="text" name="AblumName" id="AblumName" size="60" class="text ui-widget-content ui-corner-all" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="AlbumThumbnail">Hình album </label><br />
		                <input type="file" name="AlbumThumbnail" id="AlbumThumbnail" size="50" class="text ui-widget-content ui-corner-all" />
                    </td>
                </tr>
            </table>
	    </form>
    </div>
    <!-------------  ///////////////////////////////////////////////////////////-->
    <div class="private_share_post_top">
        <div class="private_sharepost_menu">
            <ul>
                <li><a href="#" class="menu_select">Đăng tải photo</a></li>
            </ul>
        </div>
        <%--<div class="private_write_right private_margin_topright">
            <div class="private_button_upload">
                <a href="photo_dangtai_private.html">
                    <img src="/../Content/Images/icon_plus_up.gif">
                    Đăng tải photo</a>
            </div>
        </div>--%>
    </div>
    <div class="private_content_onecol">
    <form action="<%=Url.Action("UploadPhoto2Album","Photo", new {uid=Session["MemId"]}) %>" id="FormUploadPhoto" method="post" enctype="multipart/form-data">
        <table width="100%" border="0">
            <tr>
                <td width="10%">
                    &nbsp;
                </td>
                <td colspan="3">
                    File: JPG, PNG, Gif.... Kích thước: 200x200 pixel Dung lượng: 100 Kb
                </td>
            </tr>

            <%
                for (int i = 1; i <= WebHoiChoMuaBan.Controllers.Global.Config.MAX_FILE_UPLOAD; i++)
                {
            %>
            <tr id="uploader<%=i %>" 
            <%
                    if (i != 1){
            %>
            style="display: none;"
            <% } %>
            >
                <td align="right">
                    <span class="private_font_bold">Tiêu đề</span>
                </td>
                <td width="51%">
                    <input type="text" name="textfield<%=i %>" id="textfield<%=i %>" class="input_full" />
                </td>
                <td width="6%" align="right">
                    <span class="private_font_bold">Hình</span>
                </td>
                <td width="33%" align="right">
                    <input type="file" name="fileField<%=i %>" id="fileField<%=i %>" />
                </td>
            </tr>
            <%
                }
            %>
            
            <tr>
                <td align="right">
                    &nbsp;
                </td>
                <td>
                    <div class="private_upload_newshot" style="width: 65%">
                        <%= Html.DropDownList("selectAlbums", (SelectList)ViewData["ListAlbums"], "Chọn album")%>
                    </div>
                    <div class="private_write_right private_margin_topright">
                        <div class="private_button_upload">
                            <a href="#" id="Create-Album">
                                <img src="/../Content/Images/icon_plus_up.gif">Tạo album mới</a>
                        </div>
                    </div>
                </td>
                <td>
                    &nbsp;
                </td>
                <td align="right">
                    <div class="private_write_right private_margin_topright">
                        <div class="private_button_upload">
                            <a id="aAddPhoto" href="javascript:void(0)">
                                <img src="/../Content/Images/icon_plus_up.gif">
                                Add thêm hình</a>
                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="right">
                    &nbsp;
                </td>
                <td colspan="3">
                    <input type="checkbox" id="checkbox7" name="checkbox7">
                    <span class="private_text_ck">Tôi cam kết nội dung đăng tin hoàn toàn lành mạnh đúng
                        với <a href="#">qui định điều khoản</a> của website hoichomuaban.com.</span>
                </td>
            </tr>
            <tr>
                <td align="right">
                </td>
                <td>
                    <div class="private_write_right">
                        <input type="submit" class="private_bt_submit_news" value="Đăng tải" id="" style="width: 100px;" />
                    </div>
                </td>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
        </form>
    </div>
</asp:Content>
